package com.ssss.build2Args;

import com.ssss.builder.Computer;

public class Test {

    public static void main(String[] args) {
        ComputerB computer = new ComputerB("主板","cpu",
                "hd","电源","显卡","鼠标","键盘");
        System.out.println("使用普通的构造方法组装电脑："+computer.toString());
        System.out.println("-------------------------------------------------");
        // 使用建造者模式
        ComputerB build = new ComputerB.CompuerBuilder()
                .setMainBoard("主板")
                .setCpu("cpu1")
                .setGraphIcsCard("GTX1060")
                .build();
        ComputerB computerB = computer.getComputer().setMainBoard("猪猪猪").setCpu("1").build();
        System.out.println("使用建造者方法组装电脑"+computerB.toString());

        // 使用lombok
        ComputerC c = new ComputerC.ComputerCBuilder().cpu("cpu").build();
        System.out.println("c"+c.toString());
    }
}
